<!DOCTYPE html>
<html>
<head>
<include file="Include:meta" />
<title>财务费用总览-目的地运营集团数据管理平台</title>
<include file="Include:style" />
</head>
<body>
<include file="Include:header" />
<include file="Include:left" />
<div id="main">
	<div class="crumbs">
		<div class="crumbs-text">财务费用总览</div>
		<div class="right">
			<div class="input-group left w300">
		    	<input type="text" id="keyword" value="{$keyword}" class="form-control" placeholder="按申请单编号/主题/费用归属人搜索" autocomplete="off">
	    		<span class="input-group-btn">
	        		<button class="btn found_btn" type="button">搜索</button>
		    	</span>
		    </div>
		</div>
	</div>
	<div id="content">
		<div class="filter">
			<div class="filter-item">
				<div class="filter-title">所属公司：</div>
				<ul class="filter-order">
					<li <if condition="$company eq -10">class="current"</if>>
						<a href="__APP__/Financial/cost_list/keyword/{$keyword}/company/-10/center_id/{$center_id}/type/{$type}/c_type/{$c_type}/f_type/{$f_type}/start/{$start}/end/{$end}">全部</a>
					</li>
					<foreach name="company_list" item="vo">
					<li <if condition="$company eq $vo['ascription_unit']">class="current"</if>>
						<a href="__APP__/Financial/cost_list/keyword/{$keyword}/company/{$vo['ascription_unit']}/center_id/{$center_id}/type/{$type}/c_type/{$c_type}/f_type/{$f_type}/start/{$start}/end/{$end}">{$vo['ascription_unit']}</a>
					</li>
					</foreach>
				</ul>
			</div>
			<div class="filter-item">
				<div class="filter-title">所属中心：</div>
				<ul class="filter-order">
					<li <if condition="$center_id eq -10">class="current"</if>>
						<a href="__APP__/Financial/cost_list/keyword/{$keyword}/company/{$company}/center_id/-10/type/{$type}/c_type/{$c_type}/f_type/{$f_type}/start/{$start}/end/{$end}">全部</a>
					</li>
					<foreach name="center_list" item="vo">
					<li <if condition="$center_id eq $vo['id']">class="current"</if>>
						<a href="__APP__/Financial/cost_list/keyword/{$keyword}/company/{$company}/center_id/{$vo['id']}/type/{$type}/c_type/{$c_type}/f_type/{$f_type}/start/{$start}/end/{$end}">{$vo['first_name']}</a>
					</li>
					</foreach>
				</ul>
			</div>
			<div class="filter-item">
				<div class="filter-title">申请类型：</div>
				<ul class="filter-order">
					<li <if condition="$type eq -10">class="current"</if>>
						<a href="__APP__/Financial/cost_list/keyword/{$keyword}/company/{$company}/center_id/{$center_id}/type/-10/start/{$start}/end/{$end}">全部</a>
					</li>
					<li <if condition="$type eq 1">class="current"</if>>
						<a href="__APP__/Financial/cost_list/keyword/{$keyword}/company/{$company}/center_id/{$center_id}/type/1/start/{$start}/end/{$end}">差旅费报销申请</a>
					</li>
					<li <if condition="$type eq 2">class="current"</if>>
						<a href="__APP__/Financial/cost_list/keyword/{$keyword}/company/{$company}/center_id/{$center_id}/type/2/start/{$start}/end/{$end}">费用报销单</a>
					</li>
					<li <if condition="$type eq 3">class="current"</if>>
						<a href="__APP__/Financial/cost_list/keyword/{$keyword}/company/{$company}/center_id/{$center_id}/type/3/start/{$start}/end/{$end}">付款申请</a>
					</li>
					<li <if condition="$type eq 4">class="current"</if>>
						<a href="__APP__/Financial/cost_list/keyword/{$keyword}/company/{$company}/center_id/{$center_id}/type/4/start/{$start}/end/{$end}">营销专项费用报销申请</a>
					</li>
					<li <if condition="$type eq 5">class="current"</if>>
						<a href="__APP__/Financial/cost_list/keyword/{$keyword}/company/{$company}/center_id/{$center_id}/type/5/start/{$start}/end/{$end}">营销专项付款申请</a>
					</li>
				</ul>
			</div>
			<if condition="$type eq 3">
			<div class="filter-item">
				<div class="filter-title">付款类型：</div>
				<ul class="filter-order">
					<li <if condition="$c_type eq -10">class="current"</if>>
						<a href="__APP__/Financial/cost_list/keyword/{$keyword}/company/{$company}/center_id/{$center_id}/type/{$type}/c_type/-10/start/{$start}/end/{$end}">全部</a>
					</li>
					<foreach name="cost_list" item="vo">
					<li <if condition="$c_type eq $vo['name1']">class="current"</if>>
						<a href="__APP__/Financial/cost_list/keyword/{$keyword}/company/{$company}/center_id/{$center_id}/type/{$type}/c_type/{$vo['name1']}/start/{$start}/end/{$end}">{$vo['name1']}</a>
					</li>
					</foreach>
				</ul>
			</div>
			</if>
			<if condition="$type neq -10">
			<div class="filter-item">
				<div class="filter-title">费用类型：</div>
				<ul class="filter-order">
					<li <if condition="$f_type eq -10">class="current"</if>>
						<a href="__APP__/Financial/cost_list/keyword/{$keyword}/company/{$company}/center_id/{$center_id}/type/{$type}/c_type/{$c_type}/f_type/-10/start/{$start}/end/{$end}">全部</a>
					</li>
					<foreach name="fcost_list" item="vo">
					<li <if condition="$f_type eq $vo['name1']">class="current"</if>>
						<a href="__APP__/Financial/cost_list/keyword/{$keyword}/company/{$company}/center_id/{$center_id}/type/{$type}/c_type/{$c_type}/f_type/{$vo['name1']}/start/{$start}/end/{$end}">{$vo['name1']}</a>
					</li>
					</foreach>
				</ul>
			</div>
			</if>
			<div class="filter-item">
				<div class="filter-title">周期筛选：</div>
				<ul class="filter-order">
					<a href="{$last_url}" class="mr10">上一周期</a>
					<input name="start" value="{$start}" type="text" class="form-control Wdate required-text w100" onclick="WdatePicker()" readonly autocomplete="off">
					-
					<input name="end" value="{$end}" type="text" class="form-control Wdate required-text w100" onclick="WdatePicker()" readonly autocomplete="off">
					<button class="btn btndate ml10" type="button">搜索</button>
					<span class='error-item'>开始日期必须小于结束日期</span>
					<a href="{$next_url}" class="ml10">下一周期</a>
				</ul>
			</div>
		</div>
		<div class="table-scrollx">
			<table class="table table-bordered table-hover">
				<tr class="table-header fixed-table-header">
					<td>申请单编号</td>
					<td>主题</td>
					<td>申请类型</td>
					<td>费用归属人</td>
					<td>所属中心</td>
					<td>申请总金额</td>
					<if condition="$f_type neq -10"><td>{$f_type}</td></if>
					<td>申请人(日期)</td>
				</tr>
				<if condition="$result eq NULL">
				<tr>
					<td <if condition="$f_type neq -10">colspan="8"<else/>colspan="7"</if> class="text-center">暂无相关内容</td>
				</tr>
				</if>
				<foreach name="result" item="vo">
				<tr>
					<td>
						<if condition="$vo['type'] eq 1">
						<a href="__APP__/Financial/cost_travel_detail/id/{$vo['id']}" target="_blank">{$vo['order_number']}</a>
						<elseif condition="$vo['type'] eq 2" />
						<a href="__APP__/Financial/cost_apply_detail/id/{$vo['id']}" target="_blank">{$vo['order_number']}</a>
						<elseif condition="$vo['type'] eq 3" />
						<a href="__APP__/Financial/cost_payment_detail/id/{$vo['id']}" target="_blank">{$vo['order_number']}</a>
						<elseif condition="$vo['type'] eq 4" />
						<a href="__APP__/Financial/cost_marketing_apply_detail/id/{$vo['id']}" target="_blank">{$vo['order_number']}</a>
						<elseif condition="$vo['type'] eq 5" />
						<a href="__APP__/Financial/cost_marketing_payment_detail/id/{$vo['id']}" target="_blank">{$vo['order_number']}</a>
						</if>
					</td>
					<td>{$vo['theme']}</td>
					<td>
						<if condition="$vo['type'] eq 1">差旅费报销申请
						<elseif condition="$vo['type'] eq 2"/>费用报销单
						<elseif condition="$vo['type'] eq 3"/>付款申请
						<elseif condition="$vo['type'] eq 4"/>营销专项费用报销申请
						<elseif condition="$vo['type'] eq 5"/>营销专项付款申请</if>
					</td>
					<td>{$vo['cost_ascription_user']}</td>
					<td>{$vo['center_name']}</td>
					<td>{$vo['total']+0}</td>
					<if condition="$f_type neq -10"><td>{$vo['f_type']+0}</td></if>
					<td>{$vo['apply_user']}({$vo['apply_date']})</td>
				</tr>
				</foreach>
			</table>
		</div>
		<div class="pages">{$page}</div>
	</div>
</div>
<include file="Include:javascript" />
<script type="text/javascript">
$(function(){
	//搜索
	$(".found_btn").keywordSearch("__APP__/Financial/cost_list/keyword/$keyword/company/{$company}/center_id/{$center_id}/type/{$type}/c_type/{$c_type}/f_type/{$f_type}/start/{$start}/end/{$end}");
	//日期筛选
	$(".btndate").click(function(){
		var start = $("[name=start]").val(),
			end = $("[name=end]").val();
		if(Date.parse(end)>=Date.parse(start)){
			window.location.href = "__APP__/Financial/cost_list/keyword/{$keyword}/company/{$company}/center_id/{$center_id}/type/{$type}/c_type/{$c_type}/f_type/{$f_type}/start/"+start+"/end/"+end;
		}else{
			$(this).nextAll(".error-item").show();
		}
	});
});
</script>
</body>
</html>